using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter46
{
	/// <summary>
	/// Example06: The Critical Density of the Universe
	/// Starting from energy conservation, derive an expression 
	/// for the critical mass density of the Universe \rho_{c} 
	/// in terms of the Hubble consrant H and the universal 
	/// gravitational constant G.
	/// </summary>
	public class Example06
	{
		public Example06()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			double c = L.Constant.SpeedOfLightInVacuum;
			double y = 365.0*24*60*60;
			double H = L.Constant.HubbleConstantLightYear;
			double G = L.Constant.GravitationalConstant;
			double rho = 3.0*H*H/8.0/Math.PI/G/c/c/y/y;
			result+=Convert.ToString(rho);      
		}
	}
}
